#ifndef WIFI_CONTROL_H
#define WIFI_CONTROL_H

#include <WiFi.h>
#include <WebServer.h>

// 网络配置
#define WIFI_SSID "MERCURY_77FC"
#define WIFI_PASS "30243024"


class WiFiControl {
private:
  WebServer server;

public:
  void begin( ) {
    
    WiFi.begin(WIFI_SSID, WIFI_PASS);
    Serial.print("Connecting to WiFi...");
    while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
    }
    Serial.println("\nConnected! IP: " + WiFi.localIP().toString());
    server.begin();
  }

  void update() {
    server.handleClient();
  }
};

#endif